/*
 * IIterativeMatrixSolver.cs
 * 
 * Copyright (c) 2003-2004, dnAnalytics Project. All rights reserved.
*/

namespace dnAnalytics.LinearAlgebra.Solvers
{
    /// <summary>
    /// The base interface for iterative matrix solvers.
    /// </summary>
    /// <remarks>
    /// Iterative solvers are used to solve the standard matrix
    /// equation <b>Ax = b</b> in an iterative way. Especially for
    /// sparse matrices this can lead to large reductions in solve time.
    /// Note that in general iterative solvers are less robust than 
    /// direct solvers.
    /// </remarks>
    public interface IIterativeMatrixSolver
    {
        /// <summary>
        /// Solves the standard matrix equation <b>Ax = b</b>.
        /// </summary>
        /// <remarks>
        /// When using the <b>Solve</b> method consider carefully if the
        /// left hand side vector can be reused. If so it would be better to 
        /// use the overloaded <b>Solve</b> method.
        /// </remarks>
        /// <param name="vector">The right hand side vector, <b>b</b>.</param>
        /// <returns>The left hand side vector, <b>x</b>.</returns>
        Vector Solve(Vector vector);

        /// <summary>
        /// Solves the standard matrix equation <b>Ax = b</b>.
        /// </summary>
        /// <param name="vector">The left hand side vector, <b>x</b>.</param>
        /// <param name="result">The right hand side vector, <b>b</b>.</param>
        void Solve(Vector vector, Vector result);
    }
}